home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr27 / iswht10.zip / ISWHAT.DOC < prev    next >
Text File  |  1995-03-26  |  11KB  |  284 lines

  1.   
  2.                                                                      
  3.  
  4.                                - IsWhat 1.0 -
  5.                              Batch File Utility
  6.                     Query Date/Day and Rename Functions
  7.  
  8.              (c)Copyright 1995, Rand Nowell - RaLin Enterprises
  9.                         "Cowboy Software!"  Free Use
  10.  
  11.    Welcome to IsWhat.  I had need of a utility like this, and found
  12.    several that would give Day of Year, or Day of Week, but thats
  13.    all.  I needed one that would do much more, so once again,
  14.    the wheel was re-invented!
  15.  
  16.    IsWhat does all the above and a lot more. If you need to perform
  17.    system events on certain days, or in certain weeks, or in a
  18.    certain month.... IsWhat is the tool you need.
  19.  
  20.    IsWhat works best from a batch file, where you can test the
  21.    errorlevel returned by the program, and branch to a specific
  22.    part of your batch file using batchfile labels.
  23.  
  24.    Not only for batch file use, IsWhat has three commands,
  25.    CALENDAR, DATENAME and DOYNAME which can be real handy in day to day
  26.    use, right from the command prompt.
  27.  
  28.    LEGAL STUFF -
  29.  
  30.    IsWhat is NOT Public Domain, the code/executables/documentation are
  31.    all protected under Copyright, by the author, Rand Nowell.
  32.  
  33.    This copy of IsWhat is released as FreeWare.
  34.  
  35.    This means you are free to use it without any registration, or
  36.    monetary compensation to the author.  It also means you can use as
  37.    many copies as you wish, on as many systems as you wish.
  38.  
  39.    You may also give copies to your friends, upload to other systems,
  40.    and otherwise freely distribute, subject to limitations below.
  41.  
  42.    You may NOT include IsWhat "bundled" with other software, without
  43.    written permission of the author.  Shareware DISK vendors MAY
  44.    include it on their disk's, as long as they charge no more than
  45.    $5.00 for a disk, AND inform the user that this fee is a COPY fee,
  46.    not a registration fee for programs on disk
  47.  
  48.    FreeWare does NOT give you the right to the following:
  49.      * Decompiling, reverse engineering, or otherwise modifying the program.
  50.      * Demanding additions/updates or fixes to the program.
  51.      * Accepting any form of payment for the program.  BBS sysops of
  52.        course may charge an access fee to users, before they can obtain
  53.        this program from their system. But no direct payment for IsWhat.
  54.  
  55.    You are MORE than welcome to "suggest" additions and enhancements.
  56.    In most cases, they are implemented, if they are good ones, that will
  57.    benefit all users.
  58.  
  59.    The author is not obligated to provide future versions of this program.
  60.    No warranties are made, you accept all liability for any damages from
  61.    use of the program. Though it has been well tested, your only guarentee
  62.    is that it will consume disk space.
  63.                                                     
  64.  
  65.    Any future version(s) may become Shareware, where a registration is
  66.    required to activate certain features.
  67.  
  68.  
  69.    REGISTRATION -
  70.  
  71.    No registration is asked for or required for this version of IsWhat.
  72.    Although if you find it useful, and use it a lot, a note or postcard
  73.    would be highly appreciated!!
  74.  
  75.    And of course, if you are just itching to part with some cash, a
  76.    donation is always appreciated. It helps defray costs of development
  77.    and distribution of utils like IsWhat.
  78.    A suggested donation would be $5.00, but any amount is gratefully
  79.    received.
  80.  
  81.  
  82.    OVERVIEW -
  83.  
  84.    IsWhat lets you determine the following:
  85.      o What DAY of the WEEK it is
  86.      o What DAY of the MONTH it is
  87.      o What MONTH of the YEAR it is
  88.      o What DAY of the YEAR it is
  89.  
  90.    It also allows you to rename a file with the current date as part
  91.    of the filename, or with a "Day of Year" extension.
  92.    And it can display a scrolling calendar to the screen, allowing you
  93.    to browse through days, months and years to figure out past, present
  94.    and future dates.
  95.  
  96.    HOW TO RUN -
  97.  
  98.    IsWhat displays a Copyright line and a small message pertaining to
  99.    the current function results, when it is run.  If you do NOT
  100.    want any messages displayed, in your batch file, set the environment
  101.    variable IWSHOW=NO  ie:  set iwshow=no
  102.    Setting it to null, or Yes allows the display, as does not setting
  103.    it at all.
  104.  
  105.    IsWhat is run with a command, some of which require an additional
  106.    value after the command.
  107.    There will be a short refresher course on using errorlevels in batch
  108.    files, after this section.
  109.  
  110.    Running IsWhat with a question mark, (?) will display an online
  111.    help screen, listing all available commands and syntax.
  112.  
  113.    Example:   ISWHAT <command> [value]
  114.  
  115.    IMPORTANT NOTE!!
  116.    All values returned are based on the system date set on your PC.
  117.    If the date is wrong, the values will be wrong.
  118.  
  119.    The following, are all the function commands available, what extra
  120.    values are required by any, and the proper command line syntax.
  121.  
  122.  
  123.  
  124.                                                     
  125.  
  126.  
  127.                                                                      
  128.  
  129.    DOW - Day of Week - Returns Errorlevel of 1 - 7
  130.       Command: ISWHAT DOW
  131.       DOW will tell you what day of the week it is, by returning the
  132.       number of the day to the calling program.
  133.       The days are numbered as such:
  134.                                        1 - Sunday
  135.                                        2 - Monday
  136.                                        3 - Tuesday
  137.                                        4 - Wednesday
  138.                                        5 - Thursday
  139.                                        6 - Friday
  140.                                        7 - Saturday
  141.  
  142.  
  143.   MONTH - Month of the Year - Returns Errorlevel of 1 - 12
  144.      Command: ISWHAT MONTH
  145.      MONTH will tell you what month of the year it is, value returned
  146.            is correspondent with the placement of the month in the calendar.
  147.            ie: January = 1,  March = 3, December = 12 etc.
  148.  
  149.  
  150.   DOM - Day of Month - Returns Errorlevel of 1 - 31
  151.      Command: ISWHAT DOM
  152.      DOM returns the value of the day of the month, ie: if its
  153.          March 27th, 1995 it will return errorlevel 27 - simple..
  154.  
  155.  
  156.   DOY - Day of the Year - Returns Errorlevel of 1 - 365
  157.  
  158.      Command: ISWHAT DOY
  159.      DOT will simply tell you what day of the year it is.
  160.  
  161.  
  162.   DATENAME - Renames file with current date as root name.
  163.  
  164.      Command: ISWHAT DATENAME [??/]<filename>
  165.      Will obtain the current date, and rename the file with that
  166.      name, and the files existing extension.
  167.      Example:  ISWHAT datename janrpt.zip  run on March 26th 1995
  168.                will result in the file being renamed 032695.ZIP
  169.  
  170.      You may give an optional 2 character prefix which will be added
  171.      in front of the datestring for the new filename.  The two characters
  172.      MUST come before the name of the file to rename, and MUST be
  173.      followed by the forward SLASH (/) character, and there MUST be
  174.      NO spaces in the string.  DATENAME RA/RA.LOG is correct,
  175.      DATENAME RA/ RA.LOG is Wrong!!  The above will result in a name
  176.      such as RA032695.ZIP
  177.  
  178.  
  179.   DOYNAME - Renames file with same root name, with extension of Day of Year.
  180.  
  181.       Command: ISWHAT DOYNAME <filename>
  182.       Example: DOYNAME TRIAL.ZIP  results in TRIAL.084, assuming the
  183.       current day of the year is 84.  Day numbers are zero padded to
  184.  
  185.                                                     
  186.  
  187.  
  188.                                                                      
  189.  
  190.       3 characters.
  191.  
  192.  
  193.   DATE - Compares given date to current date, and if its a match
  194.          will return an Errorlevel of 1.  If the dates do not match,
  195.          it will return and errorlevel of 0.
  196.  
  197.      Command:  ISWHAT DATE <date to test>
  198.      Example:  ISWHAT DATE 03/26/95
  199.  
  200.      The format of the date must follow the above example, or you
  201.      will get an Invalid Date error, the error is also generated
  202.      if the date is just plain invalid, as in 13/03/95.
  203.      Use the forward slashed (/) not \ or -
  204.  
  205.  
  206.   CALENDAR - Display scrolling calendar, current date highlighted.
  207.  
  208.     Command:  ISWHAT CALENDAR
  209.  
  210.     NOTE!  The calendar colors are set for a Color Monitor.
  211.            It has not even been tested on Mono, not sure how it
  212.            will display in that environment.
  213.  
  214.     While the calendar is displayed, you can move through the
  215.     days, months, and years.  The following keys act as described.
  216.        LftArrow/RtArrow  - Increment/Decrement Day
  217.        UpArrow/DnArrow   - Increment/Decrement Week
  218.        PgUp/PgDn         - Increment/Decrement Month
  219.        End               - Increment Year
  220.        Home              - Decrement Year
  221.        <M>               - Beginning of month, or if there, beginning
  222.                            of previous month.
  223.        <H>               - End of month, or if on last day, to last day
  224.                            of next month.
  225.        <Y>               - First day of year, or previous as above.
  226.        <R>               - Last day of year, or Next as above.
  227.        <+->              - Advance or Back one day
  228.  
  229.    Pressing ESCape will exit the Calendar.
  230.    Pressing ENTER on a date, will exit and display the date chosen.
  231.  
  232.  
  233.    BATCH FILE ERROR LEVELS:
  234.  
  235.    Using errorlevels returned by programs called from within the
  236.    batch file, provide, along with the use of LABELS, a very powerful
  237.    programming tool.
  238.  
  239.    One of the most common errors users seem to stumble on, is the
  240.    order in which errorlevels are tested.
  241.  
  242.    Errorlevels must ALWAYS be tested from HIGHEST to LOWEST.  Assuming
  243.    a program will be returning errorlevels in the range of 1 to 20, you
  244.    would first check for errorlevel 20, then 19, then 18 and so on.
  245.  
  246.                                                     
  247.  
  248.  
  249.                                                                      
  250.  
  251.    You can skip an errorlevel if you do not need to do anything based
  252.    on that level.
  253.  
  254.    The syntax for checking an errorlevel is "IF ERRORLEVEL ###" followed
  255.    by the command to execute. Which can be a dos command, or a GOTO <label>
  256.    command.  You can also check to see if the errorlevel is NOT a certain
  257.    one, ie: "IF NOT ERRORLEVEL ###"  this can be used in conjunction
  258.    with the "IF ERRORLEVEL" to closely test errorlevel values.
  259.  
  260.    The included IW_DEMO.BAT has a few of these, and some GOTO <label> calls,
  261.    which can help explain.  If you are not familiar with using errorlevels
  262.    and goto commands in your batch files, my best suggestion is to obtain
  263.    a book on batch file programming. There are some good ones out there.
  264.  
  265.    I am NOT a batch file expert, though I can usually make them do what I
  266.    want.  But the example IW_DEMO.BAT should help you somewhat.
  267.  
  268.    Again, this is not a conclusive lesson on batch file programming using
  269.    errorlevels and goto commands.  Just a small refresher thing.
  270.  
  271.   CLOSING -
  272.  
  273.   I hope you find IsWhat a useful tool.
  274.   If you do, I'd like to hear about it.  Send me a note or a postcard.
  275.   I am also open to suggestions....
  276.  
  277.   Rand Nowell           Voice: 510-651-6177
  278.   4641 Wheeler Dr.        BBS: 510-226-7731
  279.   Fremont, Ca. 94538     Fido: 1:215/710
  280.  
  281.   RaLin Enterprises - Home of "Cowboy Software!"
  282.                                                                  
  283.  
  284.